<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="generator" content="MATLAB R2018a"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><title>WLAN System modeling</title><style type="text/css">
* {margin: 0; padding: 0;}
body {text-align: start; line-height: 17.234001159668px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-style: normal; font-size: 13.9999990463257px; font-weight: normal; text-decoration: none; white-space: normal; }
h1, h2 {font-weight: normal;}
.content { padding: 30px; }

.S0 { margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;  }
.S1 { text-align: center; line-height: 26.3999977111816px; min-height: 24px; white-space: pre-wrap; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-size: 22px; white-space: pre-wrap; margin-left: 4px; margin-top: 3px; margin-bottom: 15px; margin-right: 10px;  }
.S2 { min-height: 0px; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;  }
.S3 { font-weight: bold; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;  }
.S4 { text-align: left; line-height: 20.576000213623px; min-height: 20px; white-space: pre-wrap; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; white-space: pre-wrap; margin-left: 4px; margin-top: 15px; margin-bottom: 9px; margin-right: 10px;  }
.S5 { text-align: left; line-height: 21px; min-height: 17px; white-space: pre-wrap; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px;  }
.S6 { font-family: Helvetica, Arial, sans-serif; margin-left: 0px; margin-top: 10px; margin-bottom: 20px; margin-right: 0px;  }
.S7 { text-align: left; line-height: 20.9999980926514px; white-space: pre-wrap; white-space: pre-wrap; margin-left: 55.9999961853027px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;  }
.S8 { font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;  }
.S9 { font-style: italic; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;  }

.CodeBlock {margin: 10px 0 10px 0; background-color: #F7F7F7;}
.CodeBlock+.paragraphNode {margin-top: 10px;}
.lineNode {padding-left: 10px; border-left: 1px solid #E9E9E9; border-right: 1px solid #E9E9E9;}
.inlineWrapper:first-child .lineNode,.inlineWrapper.outputs+.inlineWrapper .lineNode {padding-top: 5px; border-top: 1px solid #E9E9E9;}
.inlineWrapper:last-child .lineNode,.inlineWrapper.outputs .lineNode {padding-bottom: 5px; border-bottom: 1px solid #E9E9E9;}
.lineNode .textBox {white-space: pre;}
</style></head><body><div class = "content"><div class = 'SectionBlock containment active'><h1 class = "S1"><span class = "S2"><span class="S3">WLAN System modeling</span></span></h1><h2 class = "S4"><span class = "S2"><span class="S0">Aim of the example</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">This example demonstrates the usage of MATLAB bindings over NS3, by developing the entire WLAN network simulation scenario in MATLAB. The model estimates the performance of a WLAN network with given input (configurable) parameters.</span></span></div><h2 class = "S4"><span class = "S2"><span class="S0">Description of the example</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">This example simulates a WLAN infrastructure network of any arbitrary size. The network can be a very simple network with three nodes (an AP and two Stations) or a large one involving many 10s or 100s of nodes (APs and Stations) operating in the same channel. The stations are arranged in a grid topology, and the APs are arranged in another overlaid grid topology. The sizes of the grids depend on the number of nodes included in the simulation.</span></span></div><div class = "S5"><span class = "S2"><span class="S0">The simulation can be done with just an AP and two stations (a simple scenario), or with multiple APs and 10s of stations (a complex scenario).</span></span></div><h2 class = "S4"><span class = "S2"><span class="S0">Simple scenario</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">In simple scenario, two station nodes and an AP node are modelled.</span></span></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><div class = "S5"><span class = "S2"><span class="S3">Complex scenario</span></span></div><div class = "S5"><span class = "S2"><span class="S0">In a complex scenario, 36 Station nodes are placed in a 6x6 grid and 4 AP nodes are placed in a 2x2 grid. All the nodes are assigned the same channel. The APs are given different SSIDs, and each of the stations is configured to associate to specific AP.</span></span></div><div class = "S5"><span class = "S2"><span class="S0"> </span></span><img class="imageNode" width="588.5937377929688" style="vertical-align: baseline" src=""></div><div class = "S5"><span class = "S2"><span class="S0"> </span></span></div><div class = "S5"><span class = "S2"><span class="S0">The modeling of PHY and Channel can be done using either low-fidelity statistical models of NS3 or with a high-fidelity MATLAB WST models. The NS3 statistical models are overly optimistic compared to the high-fidelity MATLAB WST models, therefore when using the MATLAB WST model, the number of dropped packets is likely to increase when compared to the statistical model. Note the MATLAB WST model does not include interference and has only the effect of path loss between each pair of nodes.The modeling of MAC and higher layers is done in NS3. Application data traffic is modeled with data exchange between Stations connected to the same AP, through the AP.</span></span></div><div class = "S5"><span class = "S2"><span class="S0">The communication between each AP and its Stations cause interference for other nodes in the vicinity. The amount of channel contention, interference and packet losses vary based on various parameters configured in the APs and Stations. This example provides configurability for some parameters that usually impact the overall network performance.</span></span></div><h2 class = "S4"><span class = "S2"><span class="S0">Configurable parameters</span></span></h2><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">Number of nodes</span></span></li></ul><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">APs</span></span></div><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Stations</span></span></div><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">Locations of nodes in the AP grid and Station grid</span></span></li></ul><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Location of the first node in the grid</span></span></div><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Distance between nodes</span></span></div><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Width (in nodes) in the X-axis of the grid</span></span></div><div class = "S5"><span class = "S2"><span class="S8">            o </span></span><span class = "S2"><span class="S0">length of the grid in Y-axis is derived automatically</span></span></div><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">PHY parameters</span></span></li></ul><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">TX gain</span></span></div><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Rx gain</span></span></div><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">PHY data rate</span></span></div><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">Channel models</span></span></li></ul><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Propagation loss model</span></span></div><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">Application data traffic parameters</span></span></li></ul><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Traffic pattern (for example, OnOff application and on-time percentage)</span></span></div><div class = "S5"><span class = "S2"><span class="S8">            o</span></span><span class = "S2"><span class="S0">  </span></span><span class = "S2"><span class="S0"> </span></span><span class = "S2"><span class="S0">Application data traffic rate in Mbps</span></span></div><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">Simulation duration</span></span></li></ul><h2 class = "S4"><span class = "S2"><span class="S0">Results and Analysis</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">While the simulation is running, the results are gathered into log files. The results gathered at each node include:</span></span></div><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">Packets transmitted at PHY layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets received at PHY layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets dropped at PHY layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets transmitted at MAC layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets received at MAC layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets dropped at MAC layer</span></span></li></ul><h2 class = "S4"><span class = "S2"><span class="S0">Visualization of results</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">A visualization script reads the simulation results from log files, analyzes them and performs visualization. The visualization includes the following results collected at each node:</span></span></div><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">Packets transmitted at PHY layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets received at PHY layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets dropped at PHY layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Packets received at MAC layer</span></span></li></ul><h2 class = "S4"><span class = "S2"><span class="S0">Simulation results with NS3 statistical PHY model for a simple scenario</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">The simulation is done with free-space propagation model. The results are with bi-directional application traffic between Nodes 0 and 1.</span></span></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><h2 class = "S4"><span class = "S2"><span class="S0">Simulation results with NS3 statistical PHY model for a complex scenario</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">Applications running in between following nodes: 0-8, 9-4, 18-31, 27-29.</span></span></div><div class = "S5"><img class="imageNode" width="588.5937377929688" style="vertical-align: baseline" src=""></div><h2 class = "S4"><span class = "S2"><span class="S0">Simulation results with MATLAB PHY for a simple scenario</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">Bidirectional application traffic between Nodes 0 and 1.</span></span></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><h2 class = "S4"><span class = "S2"><span class="S0">Simulation results with MATLAB PHY for a complex scenario</span></span></h2><div class = "S5"><span class = "S2"><span class="S0">Applications running in between following nodes: 0-8, 9-4, 18-31, 27-29.</span></span></div><div class = "S5"><img class="imageNode" width="588" height="331" style="vertical-align: baseline" src=""></div><div class = "S5"><span class = "S2"><span class="S0">NOTE: Interference between nodes is not modeled in the MATLAB PHY and channel callback implementation, as of now. This may cause variation in results compared to NS3, when there are multiple transmitters contending for the channel.</span></span></div><h2 class = "S4"><span class = "S2"><span class="S0">Abbreviations</span></span></h2><ul class = "S6"><li class = "S7"><span class = "S0"><span class="S0">AP           Access point</span></span></li><li class = "S7"><span class = "S0"><span class="S0">MAC        Medium Access Control layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">PHY         Physical layer</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Rx            Reception</span></span></li><li class = "S7"><span class = "S0"><span class="S0">STA         Station</span></span></li><li class = "S7"><span class = "S0"><span class="S0">Tx            Transmission</span></span></li><li class = "S7"><span class = "S0"><span class="S0">WLAN      Wireless Local Area Network</span></span></li><li class = "S7"><span class = "S0"><span class="S0">WST        WLAN System Toolbox</span></span></li></ul></div></div><br><!-- <br>##### SOURCE BEGIN #####<br>%% *WLAN System modeling*<br>%% Aim of the example<br>% This example demonstrates the usage of MATLAB bindings over NS3, by developing <br>% the entire WLAN network simulation scenario in MATLAB. The model estimates the <br>% performance of a WLAN network with given input (configurable) parameters.<br>%% Description of the example<br>% This example simulates a WLAN infrastructure network of any arbitrary size. <br>% The network can be a very simple network with three nodes (an AP and two Stations) <br>% or a large one involving many 10s or 100s of nodes (APs and Stations) operating <br>% in the same channel. The stations are arranged in a grid topology, and the APs <br>% are arranged in another overlaid grid topology. The sizes of the grids depend <br>% on the number of nodes included in the simulation.<br>% <br>% The simulation can be done with just an AP and two stations (a simple scenario), <br>% or with multiple APs and 10s of stations (a complex scenario).<br>%% *Simple scenario*<br>% In simple scenario, two station nodes and an AP node are modelled.<br>% <br>% <br>% <br>% *Complex scenario*<br>% <br>% In a complex scenario, 36 Station nodes are placed in a 6x6 grid and 4 <br>% AP nodes are placed in a 2x2 grid. All the nodes are assigned the same channel. <br>% The APs are given different SSIDs, and each of the stations is configured to <br>% associate to specific AP.<br>% <br>%  <br>% <br>%  <br>% <br>% The modeling of PHY and Channel can be done using either low-fidelity statistical <br>% models of NS3 or with a high-fidelity MATLAB WST models. The NS3 statistical <br>% models are overly optimistic compared to the high-fidelity MATLAB WST models, <br>% therefore when using the MATLAB WST model, the number of dropped packets is <br>% likely to increase when compared to the statistical model. Note the MATLAB WST <br>% model does not include interference and has only the effect of path loss between <br>% each pair of nodes.The modeling of MAC and higher layers is done in NS3. Application <br>% data traffic is modeled with data exchange between Stations connected to the <br>% same AP, through the AP.<br>% <br>% The communication between each AP and its Stations cause interference for <br>% other nodes in the vicinity. The amount of channel contention, interference <br>% and packet losses vary based on various parameters configured in the APs and <br>% Stations. This example provides configurability for some parameters that usually <br>% impact the overall network performance.<br>%% Configurable parameters<br>% * Number of nodes<br>% <br>% |            o|   APs<br>% <br>% |            o|   Stations<br>% <br>% * Locations of nodes in the AP grid and Station grid<br>% <br>% |            o|   Location of the first node in the grid<br>% <br>% |            o|   Distance between nodes<br>% <br>% |            o|   Width (in nodes) in the X-axis of the grid<br>% <br>% |            o |length of the grid in Y-axis is derived automatically<br>% <br>% * PHY parameters<br>% <br>% |            o|   TX gain<br>% <br>% |            o|   Rx gain<br>% <br>% |            o|   PHY data rate<br>% <br>% * Channel models<br>% <br>% |            o|   Propagation loss model<br>% <br>% * Application data traffic parameters<br>% <br>% |            o|   Traffic pattern (for example, OnOff application and on-time <br>% percentage)<br>% <br>% |            o|   Application data traffic rate in Mbps<br>% <br>% * Simulation duration<br>%% Results and Analysis<br>% While the simulation is running, the results are gathered into log files. <br>% The results gathered at each node include:<br>% <br>% * Packets transmitted at PHY layer<br>% * Packets received at PHY layer<br>% * Packets dropped at PHY layer<br>% * Packets transmitted at MAC layer<br>% * Packets received at MAC layer<br>% * Packets dropped at MAC layer<br>%% Visualization of results<br>% A visualization script reads the simulation results from log files, analyzes <br>% them and performs visualization. The visualization includes the following results <br>% collected at each node:<br>% <br>% * Packets transmitted at PHY layer<br>% * Packets received at PHY layer<br>% * Packets dropped at PHY layer<br>% * Packets received at MAC layer<br>%% Simulation results with NS3 statistical PHY model for a simple scenario<br>% The simulation is done with free-space propagation model. The results are <br>% with bi-directional application traffic between Nodes 0 and 1.<br>% <br>% <br>% <br>% <br>% <br>% <br>%% Simulation results with NS3 statistical PHY model for a complex scenario<br>% Applications running in between following nodes: 0-8, 9-4, 18-31, 27-29.<br>% <br>% <br>%% Simulation results with MATLAB PHY for a simple scenario<br>% Bidirectional application traffic between Nodes 0 and 1.<br>% <br>% <br>% <br>% <br>% <br>% <br>%% Simulation results with MATLAB PHY for a complex scenario<br>% Applications running in between following nodes: 0-8, 9-4, 18-31, 27-29.<br>% <br>% <br>% <br>% NOTE: Interference between nodes is not modeled in the MATLAB PHY and channel <br>% callback implementation, as of now. This may cause variation in results compared <br>% to NS3, when there are multiple transmitters contending for the channel.<br>%% Abbreviations<br>% * AP           Access point<br>% * MAC        Medium Access Control layer<br>% * PHY         Physical layer<br>% * Rx            Reception<br>% * STA         Station<br>% * Tx            Transmission<br>% * WLAN      Wireless Local Area Network<br>% * WST        WLAN System Toolbox<br>##### SOURCE END #####<br>--></body></html>